3.2.72 \(\int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx\) [172]

Optimal. Leaf size=46 \[ \frac {\log (\cosh (c+d x))}{(a+b) d}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b (a+b) d} \]

[Out]

ln(cosh(d*x+c))/(a+b)/d-1/2*a*ln(a+b*tanh(d*x+c)^2)/b/(a+b)/d

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 46, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3751, 457, 78} \begin {gather*} \frac {\log (\cosh (c+d x))}{d (a+b)}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b d (a+b)} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Tanh[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]

[Out]

Log[Cosh[c + d*x]]/((a + b)*d) - (a*Log[a + b*Tanh[c + d*x]^2])/(2*b*(a + b)*d)

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 3751

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[c*(ff/f), Subst[Int[(d*ff*(x/c))^m*((a + b*(ff*x)^n)^p/(c^2
 + ff^2*x^2)), x], x, c*(Tan[e + f*x]/ff)], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rubi steps

\begin {align*} \int \frac {\tanh ^3(c+d x)}{a+b \tanh ^2(c+d x)} \, dx &=\frac {\text {Subst}\left (\int \frac {x^3}{\left (1-x^2\right ) \left (a+b x^2\right )} \, dx,x,\tanh (c+d x)\right )}{d}\\ &=\frac {\text {Subst}\left (\int \frac {x}{(1-x) (a+b x)} \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\text {Subst}\left (\int \left (-\frac {1}{(a+b) (-1+x)}-\frac {a}{(a+b) (a+b x)}\right ) \, dx,x,\tanh ^2(c+d x)\right )}{2 d}\\ &=\frac {\log (\cosh (c+d x))}{(a+b) d}-\frac {a \log \left (a+b \tanh ^2(c+d x)\right )}{2 b (a+b) d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 42, normalized size = 0.91 \begin {gather*} \frac {2 b \log (\cosh (c+d x))-a \log \left (a+b \tanh ^2(c+d x)\right )}{2 a b d+2 b^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Tanh[c + d*x]^3/(a + b*Tanh[c + d*x]^2),x]

[Out]

(2*b*Log[Cosh[c + d*x]] - a*Log[a + b*Tanh[c + d*x]^2])/(2*a*b*d + 2*b^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.69, size = 70, normalized size = 1.52

method result size
derivativedivides \(\frac {-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 b +2 a}-\frac {a \ln \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}{2 \left (a +b \right ) b}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 b +2 a}}{d}\) \(70\)
default \(\frac {-\frac {\ln \left (\tanh \left (d x +c \right )-1\right )}{2 b +2 a}-\frac {a \ln \left (a +b \left (\tanh ^{2}\left (d x +c \right )\right )\right )}{2 \left (a +b \right ) b}-\frac {\ln \left (1+\tanh \left (d x +c \right )\right )}{2 b +2 a}}{d}\) \(70\)
risch \(\frac {x}{a +b}-\frac {2 x}{b}-\frac {2 c}{b d}+\frac {2 a x}{b \left (a +b \right )}+\frac {2 a c}{b d \left (a +b \right )}+\frac {\ln \left (1+{\mathrm e}^{2 d x +2 c}\right )}{b d}-\frac {a \ln \left ({\mathrm e}^{4 d x +4 c}+\frac {2 \left (a -b \right ) {\mathrm e}^{2 d x +2 c}}{a +b}+1\right )}{2 b d \left (a +b \right )}\) \(117\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x,method=_RETURNVERBOSE)

[Out]

1/d*(-1/(2*b+2*a)*ln(tanh(d*x+c)-1)-1/2/(a+b)*a/b*ln(a+b*tanh(d*x+c)^2)-1/(2*b+2*a)*ln(1+tanh(d*x+c)))

________________________________________________________________________________________

Maxima [A]
time = 0.49, size = 82, normalized size = 1.78 \begin {gather*} -\frac {a \log \left (2 \, {\left (a - b\right )} e^{\left (-2 \, d x - 2 \, c\right )} + {\left (a + b\right )} e^{\left (-4 \, d x - 4 \, c\right )} + a + b\right )}{2 \, {\left (a b + b^{2}\right )} d} + \frac {d x + c}{{\left (a + b\right )} d} + \frac {\log \left (e^{\left (-2 \, d x - 2 \, c\right )} + 1\right )}{b d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/2*a*log(2*(a - b)*e^(-2*d*x - 2*c) + (a + b)*e^(-4*d*x - 4*c) + a + b)/((a*b + b^2)*d) + (d*x + c)/((a + b)
*d) + log(e^(-2*d*x - 2*c) + 1)/(b*d)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 118 vs. \(2 (44) = 88\).
time = 0.39, size = 118, normalized size = 2.57 \begin {gather*} -\frac {2 \, b d x + a \log \left (\frac {2 \, {\left ({\left (a + b\right )} \cosh \left (d x + c\right )^{2} + {\left (a + b\right )} \sinh \left (d x + c\right )^{2} + a - b\right )}}{\cosh \left (d x + c\right )^{2} - 2 \, \cosh \left (d x + c\right ) \sinh \left (d x + c\right ) + \sinh \left (d x + c\right )^{2}}\right ) - 2 \, {\left (a + b\right )} \log \left (\frac {2 \, \cosh \left (d x + c\right )}{\cosh \left (d x + c\right ) - \sinh \left (d x + c\right )}\right )}{2 \, {\left (a b + b^{2}\right )} d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(2*b*d*x + a*log(2*((a + b)*cosh(d*x + c)^2 + (a + b)*sinh(d*x + c)^2 + a - b)/(cosh(d*x + c)^2 - 2*cosh(
d*x + c)*sinh(d*x + c) + sinh(d*x + c)^2)) - 2*(a + b)*log(2*cosh(d*x + c)/(cosh(d*x + c) - sinh(d*x + c))))/(
(a*b + b^2)*d)

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 306 vs. \(2 (36) = 72\).
time = 4.28, size = 306, normalized size = 6.65 \begin {gather*} \begin {cases} \tilde {\infty } x \tanh {\left (c \right )} & \text {for}\: a = 0 \wedge b = 0 \wedge d = 0 \\\frac {x - \frac {\log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{d} - \frac {\tanh ^{2}{\left (c + d x \right )}}{2 d}}{a} & \text {for}\: b = 0 \\\frac {2 d x \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 d x}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} - \frac {2 \log {\left (\tanh {\left (c + d x \right )} + 1 \right )} \tanh ^{2}{\left (c + d x \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {2 \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} + \frac {1}{2 b d \tanh ^{2}{\left (c + d x \right )} - 2 b d} & \text {for}\: a = - b \\\frac {x \tanh ^{3}{\left (c \right )}}{a + b \tanh ^{2}{\left (c \right )}} & \text {for}\: d = 0 \\- \frac {a \log {\left (- \sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} - \frac {a \log {\left (\sqrt {- \frac {a}{b}} + \tanh {\left (c + d x \right )} \right )}}{2 a b d + 2 b^{2} d} + \frac {2 b d x}{2 a b d + 2 b^{2} d} - \frac {2 b \log {\left (\tanh {\left (c + d x \right )} + 1 \right )}}{2 a b d + 2 b^{2} d} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)**3/(a+b*tanh(d*x+c)**2),x)

[Out]

Piecewise((zoo*x*tanh(c), Eq(a, 0) & Eq(b, 0) & Eq(d, 0)), ((x - log(tanh(c + d*x) + 1)/d - tanh(c + d*x)**2/(
2*d))/a, Eq(b, 0)), (2*d*x*tanh(c + d*x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*d) - 2*d*x/(2*b*d*tanh(c + d*x)**2 -
 2*b*d) - 2*log(tanh(c + d*x) + 1)*tanh(c + d*x)**2/(2*b*d*tanh(c + d*x)**2 - 2*b*d) + 2*log(tanh(c + d*x) + 1
)/(2*b*d*tanh(c + d*x)**2 - 2*b*d) + 1/(2*b*d*tanh(c + d*x)**2 - 2*b*d), Eq(a, -b)), (x*tanh(c)**3/(a + b*tanh
(c)**2), Eq(d, 0)), (-a*log(-sqrt(-a/b) + tanh(c + d*x))/(2*a*b*d + 2*b**2*d) - a*log(sqrt(-a/b) + tanh(c + d*
x))/(2*a*b*d + 2*b**2*d) + 2*b*d*x/(2*a*b*d + 2*b**2*d) - 2*b*log(tanh(c + d*x) + 1)/(2*a*b*d + 2*b**2*d), Tru
e))

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 96 vs. \(2 (44) = 88\).
time = 0.46, size = 96, normalized size = 2.09 \begin {gather*} -\frac {\frac {a \log \left (a e^{\left (4 \, d x + 4 \, c\right )} + b e^{\left (4 \, d x + 4 \, c\right )} + 2 \, a e^{\left (2 \, d x + 2 \, c\right )} - 2 \, b e^{\left (2 \, d x + 2 \, c\right )} + a + b\right )}{a b + b^{2}} + \frac {2 \, {\left (d x + c\right )}}{a + b} - \frac {2 \, \log \left (e^{\left (2 \, d x + 2 \, c\right )} + 1\right )}{b}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tanh(d*x+c)^3/(a+b*tanh(d*x+c)^2),x, algorithm="giac")

[Out]

-1/2*(a*log(a*e^(4*d*x + 4*c) + b*e^(4*d*x + 4*c) + 2*a*e^(2*d*x + 2*c) - 2*b*e^(2*d*x + 2*c) + a + b)/(a*b +
b^2) + 2*(d*x + c)/(a + b) - 2*log(e^(2*d*x + 2*c) + 1)/b)/d

________________________________________________________________________________________

Mupad [B]
time = 1.24, size = 46, normalized size = 1.00 \begin {gather*} -\frac {\frac {a\,\ln \left (b\,{\mathrm {tanh}\left (c+d\,x\right )}^2+a\right )}{2}+b\,\left (\ln \left (\mathrm {tanh}\left (c+d\,x\right )+1\right )-d\,x\right )}{b\,d\,\left (a+b\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tanh(c + d*x)^3/(a + b*tanh(c + d*x)^2),x)

[Out]

-((a*log(a + b*tanh(c + d*x)^2))/2 + b*(log(tanh(c + d*x) + 1) - d*x))/(b*d*(a + b))

________________________________________________________________________________________